package com.itheima.d7_IO.BufferedReader;


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.Reader;

public class Test {
    public static void main(String[] args) {
        // 1. 将低级的字符流包装成高级流  E:\FileResource\Test.txt
        try (
                Reader fileReader = new FileReader("E:\\FileResource\\Test.txt");
                BufferedReader bufferedReader = new BufferedReader(fileReader);

        ) {
            char[] chars = new char[1024];//1024个字符的桶
            int len; //读了多少个
            while((len = bufferedReader.read(chars))!=-1){
                String s = new String(chars,0,len);
                System.out.print(s);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}
